home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
57670
/
57670.xpi
/
chrome
/
content
/
browser.js
next >
Wrap
Text File
|
2010-02-05
|
2KB
|
55 lines
clpics.update_status_panel = function(e) {
document.getElementById("clpics-status-bar-icon").src =
clpics.pref("enable")
? "chrome://clpics/skin/status-bar.png"
: "chrome://clpics/skin/status-bar-disabled.png"
}
clpics.status_panel_click = function(event) {
switch(event.which) {
// left click
case 1:
clpics.pref("enable", !clpics.pref("enable"))
clpics.update_status_panel()
break
// right click
case 3:
var prefswin = window.openDialog("chrome://clpics/content/options.xul", "clpics-preferences-window")
// Linux (and Mac?) users get instant feedback
prefswin.addEventListener("load", function(){
this.document.getElementById("enable").addEventListener("click", function(){
this.ownerDocument.defaultView.opener.setTimeout(clpics.update_status_panel, 10)
}, false)
}, false)
// Windows users, not so much
prefswin.addEventListener("unload", function(){setTimeout(clpics.update_status_panel, 10)}, false)
break
}
}
clpics.logobj = function(obj) {
var t = []
for (var i in obj)
try {
t.push(i+": "+String(obj[i]).split("\n").reverse().pop())
}
catch(e){}
clpics.log(t.sort().join("\n"))
}
document.addEventListener("DOMContentLoaded", function(){
clpics.update_status_panel()
document.getElementById("clpics-status-bar-icon").addEventListener("click", clpics.status_panel_click, false)
// Load jQuery without messing with the toolbars.
// Dunno why this is necessary, but it is and it works, so meh
Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader)
.loadSubScript("chrome://clpics/content/jquery-1.3.2.min.js");
// var t = []
// for (var i in window)
// try {t.push(i+": "+String(window[i]).split("\n").reverse().pop())}
// catch(e){}
// clpics.log("\n"+t.sort().join("\n"))
}, false)